#pragma once
#include "vector4.h"

#define TEMPLATE template <typename T> 
#define VECTOR4 Vector4T<T>

BEGIN_NAMESPACE_OXGE

	TEMPLATE 
	const VECTOR4 VECTOR4::ZERO(0,0,0,0);

	TEMPLATE
	const VECTOR4 VECTOR4::UNIT_X(1,0,0,0);

	TEMPLATE 
	const VECTOR4 VECTOR4::UNIT_Y(0,1,0,0);

	TEMPLATE 
	const VECTOR4 VECTOR4::UNIT_Z(0,0,1,0);

	TEMPLATE 
	const VECTOR4 VECTOR4::UNIT_P(0,0,0,1);

	TEMPLATE 
	const VECTOR4 VECTOR4::UNIT_SCALE(1,1,1,1);

	//cross
	TEMPLATE
	VECTOR4 VECTOR4::cross(const VECTOR4& vec1, const VECTOR4&vec2)const
	{
		return ZERO;
	}


	TEMPLATE
	std::ostream& operator<<(std::ostream& os, const VECTOR4& vec)
	{
		os << "(";
		size_t i = 0;
		for(;i<vec.NLen-1;++i)
		{
			os << vec[i] << ',';
		}
		os << vec[i] ;
		os << ")";

		return os;
	}


	//testing vector4
	TEMPLATE
	void VECTOR4::UnitTest()
	{
		T cvArray[] = { 1,2,3,4,5 };
		VectorType vec;
		VectorType vec1(1,2,3,4);
		VectorType vec2(cvArray);
		
		vec *= 2;
		vec2 += vec1;
		vec2 -= vec1;
		vec1 + vec2;
		vec1 - vec2; 
		vec1 * 2;
		2 * vec1;

		vec[2];
		vec1.dot(vec2);
		vec.cross(vec1, vec2);

		vec.Normalize();
		vec.SquareLength();
		vec.Length();

		vec = UNIT_X;
		vec = UNIT_SCALE;
		vec = UNIT_Y;
		vec = UNIT_Z;
		vec = UNIT_P;
		vec = ZERO;


	}

END_NAMESPACE_OXGE

#undef TEMPLATE
#undef VECTOR4
